﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="3-9.aspx.cs" Inherits="计科2111林开心06._3_9" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
        </div>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="id,name" DataSourceID="LinqDataSource1">
            <Columns>
                <asp:CommandField ShowSelectButton="True" />
                <asp:TemplateField HeaderText="id" SortExpression="id">
                    <EditItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("id") %>'></asp:Label>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("id") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="name" HeaderText="name" ReadOnly="True" SortExpression="name" />
            </Columns>
        </asp:GridView>
        <asp:DetailsView ID="DetailsView1" runat="server"  AutoGenerateRows="False" DataSourceID="LinqDataSource2" Height="67px" Width="197px" >
            <Fields>
                <asp:BoundField DataField="id" HeaderText="id" ReadOnly="True" SortExpression="id" />
                <asp:BoundField DataField="name" HeaderText="name" ReadOnly="True" SortExpression="name" />
                <asp:BoundField DataField="sex" HeaderText="sex" ReadOnly="True" SortExpression="sex" />
                <asp:BoundField DataField="cid" HeaderText="cid" ReadOnly="True" SortExpression="cid" />
                <asp:BoundField DataField="score" HeaderText="score" ReadOnly="True" SortExpression="score" />
               
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowInsertButton="True" />
               
            </Fields>
        </asp:DetailsView>
        <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="计科2111林开心06.StruInfoDataContext" EntityTypeName="" Select="new (id, name)" TableName="Studnet">
        </asp:LinqDataSource>
        <asp:LinqDataSource ID="LinqDataSource2" runat="server" ContextTypeName="计科2111林开心06.StruInfoDataContext" EnableDelete="True" EnableInsert="True" EnableUpdate="True" EntityTypeName="" TableName="Studnet" Where="id == @id">
            <WhereParameters>
                <asp:ControlParameter ControlID="GridView1" DefaultValue="1" Name="id" PropertyName="SelectedValue" Type="String" />
            </WhereParameters>
        </asp:LinqDataSource>
    </form>
</body>
</html>
